# coding=utf-8

__author__ = 'Sea'

def response_format_decorator(view_func):
    def _wrapped_view_func(request, *args, **kwargs):
        format = request.GET.get('format')
        if not format:
            format = 'html'
        request.response_format = format.lower()
        response = view_func(request, *args, **kwargs)
        return response
    return _wrapped_view_func
